	.text
.global fact
.type fact,@function
fact:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$4,%esp
	leal	-4(%ebp), %eax
	pushl	%eax
	leal	8(%ebp), %eax
	movl	(%eax), %eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	leal	-4(%ebp), %eax
	movl	(%eax), %eax
	cmpl	$0, %eax
	je	.Lbl1
	jmp	.Lbl0
.Lbl0:
	leal	8(%ebp), %eax
	movl	(%eax), %eax
	pushl	%eax
	movl	$1, %eax
	movl	%eax, %ebx
	popl	%eax
	subl	%ebx, %eax
	pushl	%eax
	call	fact
	addl	$4,%esp
	pushl	%eax
	leal	8(%ebp), %eax
	movl	(%eax), %eax
	popl	%ebx
	imull	%ebx, %eax
	jmp	.epilogo_fact
.Lbl1:
	movl	$1, %eax
	jmp	.epilogo_fact
.epilogo_fact:
	movl	%ebp, %esp
	popl	%ebp
	ret
	.text
.global extendedAscii
.type extendedAscii,@function
extendedAscii:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$0,%esp
	leal	8(%ebp), %eax
	movsbl	(%eax), %eax
	pushl	%eax
	call	abs
	addl	$4,%esp
	pushl	%eax
	leal	8(%ebp), %eax
	movsbl	(%eax), %eax
	popl	%ebx
	addl	%ebx, %eax
	cmpl	$0, %eax
	je	.Lbl3
	jmp	.Lbl2
.Lbl2:
	leal	8(%ebp), %eax
	movsbl	(%eax), %eax
	jmp	.epilogo_extendedAscii
.Lbl3:
	movl	$127, %eax
	pushl	%eax
	leal	8(%ebp), %eax
	movsbl	(%eax), %eax
	negl	%eax
	popl	%ebx
	addl	%ebx, %eax
	jmp	.epilogo_extendedAscii
.epilogo_extendedAscii:
	movl	%ebp, %esp
	popl	%ebp
	ret
	.text
.global main
.type main,@function
main:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$21,%esp
	leal	-21(%ebp), %eax
	pushl	%eax
	movl	$3, %eax
	popl	%ebx
	movb	%al,  0(%ebx)
	movl	$x, %eax
	pushl	%eax
	movl	$6, %eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	movl	$.S0, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S1, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S2, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S3, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S4, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S5, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	leal	-21(%ebp), %eax
	movsbl	(%eax), %eax
	pushl	%eax
	call	fact
	addl	$4,%esp
	pushl	%eax
	leal	-21(%ebp), %eax
	movsbl	(%eax), %eax
	pushl	%eax
	movl	$.S6, %eax
	pushl	%eax
	call	printf
	addl	$12,%esp
	movl	$.S7, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S8, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S9, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S10, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S11, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S12, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	leal	-4(%ebp), %eax
	pushl	%eax
	movl	$4, %eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	leal	-8(%ebp), %eax
	pushl	%eax
	movl	$8, %eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	movl	$.S13, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S14, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	leal	-12(%ebp), %eax
	pushl	%eax
	leal	-4(%ebp), %eax
	pushl	%eax
	movl	(%eax), %eax
	incl	%eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	decl	%eax
	pushl	%eax
	leal	-8(%ebp), %eax
	movl	(%eax), %eax
	popl	%ebx
	cdq
	divl	%ebx
	movl	%edx, %eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	movl	$.S15, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	leal	-12(%ebp), %eax
	movl	(%eax), %eax
	pushl	%eax
	movl	$.S16, %eax
	pushl	%eax
	call	printf
	addl	$8,%esp
	leal	-4(%ebp), %eax
	movl	(%eax), %eax
	pushl	%eax
	movl	$.S17, %eax
	pushl	%eax
	call	printf
	addl	$8,%esp
	movl	$.S18, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S19, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	leal	-16(%ebp), %eax
	pushl	%eax
	movb	$102, %al
	popl	%ebx
	movsbl	%al, %eax
	movl	%eax, 0(%ebx)
	leal	-16(%ebp), %eax
	movl	(%eax), %eax
	pushl	%eax
	movl	$.S20, %eax
	pushl	%eax
	call	printf
	addl	$8,%esp
	movl	$.S21, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$.S22, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	leal	-21(%ebp), %eax
	pushl	%eax
	movl	$1, %eax
	pushl	%eax
	movb	$65, %al
	popl	%ebx
	addl	%ebx, %eax
	popl	%ebx
	movb	%al,  0(%ebx)
	leal	-21(%ebp), %eax
	pushl	%eax
	leal	-21(%ebp), %eax
	pushl	%eax
	movsbl	(%eax), %eax
	decl	%eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	popl	%ebx
	movb	%al,  0(%ebx)
	leal	-21(%ebp), %eax
	pushl	%eax
	leal	-21(%ebp), %eax
	pushl	%eax
	movsbl	(%eax), %eax
	incl	%eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	popl	%ebx
	movb	%al,  0(%ebx)
	movl	$c, %eax
	pushl	%eax
	leal	-21(%ebp), %eax
	pushl	%eax
	movsbl	(%eax), %eax
	incl	%eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	decl	%eax
	popl	%ebx
	movl	%eax, 0(%ebx)
	leal	-21(%ebp), %eax
	movsbl	(%eax), %eax
	pushl	%eax
	movl	$.S23, %eax
	pushl	%eax
	call	printf
	addl	$8,%esp
	movl	$c, %eax
	movl	(%eax), %eax
	pushl	%eax
	movl	$.S24, %eax
	pushl	%eax
	call	printf
	addl	$8,%esp
	movl	$.S25, %eax
	pushl	%eax
	call	printf
	addl	$4,%esp
	movl	$200, %eax
	pushl	%eax
	movb	$50, %al
	popl	%ebx
	addl	%ebx, %eax
	pushl	%eax
	call	extendedAscii
	addl	$4,%esp
	pushl	%eax
	movl	$.S26, %eax
	pushl	%eax
	call	printf
	addl	$8,%esp
	movl	$0, %eax
	jmp	.epilogo_main
.epilogo_main:
	movl	%ebp, %esp
	popl	%ebp
	ret
.section .data
.comm c, 4, 4
.comm x, 4, 4
.comm y, 4, 4
.section	.rodata
.S3:	.string	"*******************************************************\n\n\n"
.S2:	.string	"Autores: Alfonso Sendra Gemero y Rafael Sanchez Martinez\n"
.S8:	.string	"En las llamadas a funciones exteriores se permiten varios argumentos\n"
.S26:	.string	"Extended Ascii de '2'+200 : %d\n\n"
.S25:	.string	"Extended ascii muestra el codigo ascii extendido de un char (signed byte)\n\n"
.S18:	.string	"Implementadas la conversion de tipos y el chequeo entre int y char\n\n"
.S21:	.string	"Incremento y decremento con caracteres\n\n"
.S17:	.string	"La variable 'a' fue post incrementada a %d\n\n"
.S4:	.string	"Llamada  a función factorial: \n"
.S1:	.string	"Programa de prueba de compilador de PLI\n"
.S16:	.string	"Resto de entre b (8) y a(4) es: %d\n\n"
.S13:	.string	"Se implementa el modulo y los pre-incrementos y post-incrementos\n\n"
.S11:	.string	"Se permiten secuencias de asignaciones \n\n"
.S20:	.string	"Signed Ascii de f es %d\n"
.S15:	.string	"Vemos el resultado: \n\n"
.S0:	.string	"\n*******************************************************\n"
.S7:	.string	"\n\n"
.S12:	.string	"a=4,b=8; \n\n"
.S24:	.string	"c ha de quedar como 66: %d\n"
.S10:	.string	"como se puede comprobar por las llamadas a printf que hace este programa \n\n"
.S6:	.string	"factorial(%d) = %d\n"
.S19:	.string	"letraF = 'f';\nprintf(\"Signed Ascii de f es %%d\\n\",letraf);\n\n"
.S23:	.string	"m ha de quedar como 'C': %c\n"
.S22:	.string	"m= ('A' + 1);\nm = --m;\nm = ++m;\nc = m++;\n\n"
.S5:	.string	"printf(\"factorial(%%d) = %%d\\n\", m, fact(m)); \n\n"
.S9:	.string	"y caracteres alfanumericos, \n"
.S14:	.string	"z = b %% a++; \n\n"
